package v1

import (
	"github.com/gin-gonic/gin"
	"net/http"
	"teacher-helper/models/request"
	"teacher-helper/service"
)

func GetFilterStudents(c *gin.Context)  {
	var filterInfo request.FilterInfo
	if err := c.ShouldBind(&filterInfo); err != nil {
		c.JSON(201, gin.H{"msg": err, "data": nil})
		return
	}
	scores, err := service.FilterPartyStudent(filterInfo)
	if err != nil {
		c.JSON(202, gin.H{"msg": err, "data": nil})
	} else {
		c.JSON(http.StatusOK, gin.H{"msg": "获取学生列表成功", "data": scores})
	}
}
